import React, { Component } from 'react';
import './Navbar.scss'
import logo from '../list1.png'

class Navbar extends Component {
    constructor(props){
        super(props);
        this.state={ //定义组件状态
            arr:[
                {name:'店铺',pic:logo},
                {name:'分类',pic:logo},
                {name:'全部商品',pic:logo},
                {name:'购物车',pic:logo},
                {name:'个人中心',pic:logo}

            ]
        }
    }
    render() {
        return (
            <div className='navbar'>
                 {
                     this.state.arr.map((item)=>{
                         return(
                             <div className='block'>
                                <img src={item.pic} alt="" />
                                <div className='name'>{item.name}</div>
                             </div>
                         )
                     })
                 }
            </div>
        );
    }
}

export default Navbar;